package com.jyu.apts.dto;

import com.jyu.apts.entity.ItemProcessRecord;
import com.jyu.apts.entity.ItemProcessRecordTemplateInfo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ItemProcessRecordTemplateInfoDto {
	long id;//主键
	String dataValues;
	InfoTemplateDto infoTemplate;
	ItemProcessRecordDto itemProcessRecord;
	public ItemProcessRecordTemplateInfoDto convert(ItemProcessRecordTemplateInfo itemProcessRecordTemplateInfo) {
		setId(itemProcessRecordTemplateInfo.getId());
		setDataValues(itemProcessRecordTemplateInfo.getDataValues());
		setInfoTemplate(new InfoTemplateDto().convert(itemProcessRecordTemplateInfo.getInfoTemplate()));
		ItemProcessRecord itemProcessRecord = itemProcessRecordTemplateInfo.getItemProcessRecord();
		if(itemProcessRecord != null) {
			setItemProcessRecord(new ItemProcessRecordDto().convert(itemProcessRecord));
		}
		return this;
	}
}
